package acewem.utilities.test;

import org.apache.commons.math3.analysis.MultivariateFunction;

public class Optimiser implements MultivariateFunction
{

 private double Power=0;
 private double probabilityofAcceptance=0;
 private double fittedMu;
 private double fittedSigma;
 public Optimiser()
 {
 }

 public void setPower(double Power) 
 {
 this.Power = Power;
 }

 public void setProbabilityofAcceptance(double probabilityofAcceptance) 
 {
 this.probabilityofAcceptance = probabilityofAcceptance;
 }	

 public double value(double[] point) 
 {
 //return (point[0]+point[1]*this.Power)* this.probabilityofAcceptance;
 double marginalCost=(point[0]+point[1]*this.Power)/this.Power;
 return (marginalCost*Power-TRUE COST)*(1-normalFitted.cumulative(marginalCost,fittedmu,fittedsigma);
 }
}